package server;

import com.lagou.server.HttpProtocoUtil;
import com.lagou.server.HttpServlet;
import com.lagou.server.Request;
import com.lagou.server.Response;

import java.io.IOException;

public class MyServlet1 extends HttpServlet{
    @Override
    public void doGet(Request request, Response response) {
       doPost(request,response);
    }

    @Override
    public void doPost(Request request, Response response) {
        String content="<h1>MyServlet1  post</h1>";
        try {
            response.output((HttpProtocoUtil.getHttpHeader200(content.getBytes().length)+content));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void init() {

    }

    @Override
    public void destory() {

    }
}
